<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>kissy anim promise demo</title>
</head>
<body>
<script src="/kissy/build/seed-debug.js"></script>
<script src="/kissy/src/package.js"></script>
<div style="border:1px solid red;width: 100px;height: 100px" id="t">

</div>
<script>
    KISSY.use('node,anim/timer', function (S, Node, TimerAnim) {
        var start = (+new Date());
        var t = Node.all('#t')[0];
        var anim = new TimerAnim(t, {width: 200}, {
            duration: 1,
            complete: function () {
                S.log('first');
                S.log(this);
                S.log((+new Date()) - start);
            }
        }).run()
                .progress(function () {
                    S.log(arguments[0]);
                })
                .then(function () {
                    S.log('second');
                    S.log(anim);
                    S.log((+new Date()) - start);
                });
    });
</script>
</body>
</html>